﻿using System.Drawing;
using System.IO;
using System.Net;

namespace NetflixFormsApplication.Presentors
{
    public static class MovieArtUtility
    {
        public static Image CreateMovieImageFromUrl(string imageUrl)
        {
            Image image = null;
            WebRequest req = WebRequest.Create(imageUrl);
            WebResponse response = req.GetResponse();
            Stream stream = response.GetResponseStream();

            if (stream != null)
            {
                image = Image.FromStream(stream);
                stream.Close();
            }
            return image;
        }

    }
}
